home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 December / Chip_2001-12_cd1.bin / zkuste / tuning / download / xteq / setup.exe / {app} / plugins / XQ Explorer Drive Hide.xpl < prev    next >
Text File  |  2001-05-14  |  2KB  |  70 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="9"
  3. "COUNT"="1"
  4. "UIPATH"="Appearance\Files&Folders\Drives"
  5. "NAME"="Show/Hide Drives"
  6. "VERSION"="2.32"
  7. "LANGUAGE"="VBScript"
  8. "TEXT 1"="Hide drives"
  9. "DESCRIPTION 1"="Maybe you don't want that all drives are visible inside the Windows Explorer. In this case, simply unchecked the drives that should be hidden and they won't be visible anymore."
  10. "DESCRIPTION 2"="If you are using Internet Explorer 4.0, you need to restart before the changes are visible."
  11. "DESCRIPTION 3"="WARNING: As soon as at least one drive is hiden, the 'Open' and 'Explore' options on the context menu of the Start Menu are greyed out. This is a side effect of Windows."
  12. "AUTHOR"="Thomas Zundel / Xteq Systems"
  13. "CONTACTURL"="http://www.xteq.com"
  14. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  15. "COMMENT 1"="Thanks to Pierre Szwarc [mailto:szwarc@usa.net] for reporting the "wrong datatype" bug."
  16. "COMMENT 2"="Thanks to Dusty Phillips [dustyphillips@yahoo.com] for reporting the second "wrong datatype" bug."
  17. "COMMENT 3"="Thanks to Thomas Zundel [mailto:Thomas.Zundel@htp-tel.de] for fixing the "TeX HeX is to stupid for bit operations" bug!"
  18.  
  19. sP="HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\"
  20. sV="NoDrives"
  21. i=0
  22.  
  23. Sub Plugin_Initialize 
  24. if RegPathExists(sP) then
  25.     i=RegReadValue(sP & sV)
  26.     if IsEmpty(i)=true then
  27.         'No drives hiden
  28.         i=0
  29.     elseif len(i)=0 or IsNumeric(i)=false then
  30.         'wrong datatype!!!
  31.         i=0
  32.     end if
  33.  
  34.     for x=1 to 26
  35.         Call SetUIElement(x,"Show drive " & Chr(64 + x) & ":\")
  36.         if (i and (2^(x-1))) <> 0 then
  37.             Call SetUIElementEx(x,false)
  38.         else
  39.             Call SetUIElementEx(x,true)
  40.         end if
  41.     next
  42. else
  43.     Disable
  44. end if
  45. End Sub
  46.  
  47. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  48. i=0
  49. for x=1 to 26
  50.     if GetUIElementEx(x)=false then i=i + (2^(x-1))
  51. next
  52.  
  53. if i=0 then
  54.    'we can kill the value
  55.    if RegValueExists(sP & sV)=true then
  56.       Call RegDeleteValue(sP & sV)
  57.    end if
  58. else 
  59.    Call RegWriteValue(sP & sV,i,2)
  60. end if
  61.  
  62. Call IndicateSettingChange()
  63. 'Not needed?
  64. 'Restart
  65.  
  66. End Sub
  67.  
  68. Sub Plugin_Terminate 
  69. End Sub
  70.